List of promo codes in the order

This request is used to get a list of promo codes for a particular order.

Request syntax

GET https://b2b-api.go.yandex.ru/integration/2.0/promocodes/orders/codes/list?order_id=<order ID>
limit=<number of records> 
&cursor=<tag from the previous request>

Request headers

  • Authorization: Bearer <OAuth-token>
    OAuth access token. The steps to get a token are described in Getting started.
  • X-YaTaxi-Selected-Corp-Client-Id — client ID from the account. Required if multiple clients are available using the token.

Request parameters

The request contains a required parameter:

  • order_id: The order ID.

The request may contain the following optional parameters:

  • limit: The number of records to output. If this parameter is omitted, information about the first 100 entries is returned.
  • cursor: The request tag (returned in the body of the response to the previous request). You don't need to specify this parameter for the request of the first page, but you need to do it for all subsequent pages.

Response field description

The response may contain the following fields:

Field

Description

Format

codes

A list of promo codes in one particular order.

Array of objects

Structure of the codes array element:

Field

Description

Format

code

Promo code.

String

id

Promo code ID.

String

status

Promo code status.

String

is_revoked

An indicator that the promo code has been revoked.

Boolean

usages

A list of usages.

Array of objects

Structure of the usages array element:

Field

Description

Format

used_at

The date a promo code was used in datetime format.

String

Request example

POST https://b2b-api.go.yandex.ru/integration/2.0/promocodes/orders/codes/list?order_id=fa0...6f3
Authorization: Bearer <OAuth-token>
X-YaTaxi-Selected-Corp-Client-Id: <client-id>

Response example

{
  "codes": [
    {
      "code": "b2b...862",
      "id": "e6z...60b",
      "status": "used",
      "usages": [
        {
          "used_at": "2024-10-29T14:31:57.803131Z"
        }
      ]
    },
    {
      "code": "b2b...397",
      "id": "ca5...b30",
      "status": "active",
      "usages": []
    }
  ]
}

Response codes

The response to this request can contain the following standard HTTP codes:

  • 200: Request completed successfully.
  • 400: An unknown parameter or a parameter with an invalid value was passed in the request.
  • 403: The client doesn't have sufficient rights to run this request.
    • SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header X-YaTaxi-Selected-Corp-Client-Id (returned if more than one client is available for the token).
    • SELECTED_CLIENT_ACCESS_DENIED: the header X-YaTaxi-Selected-Corp-Client-Id contains the client's ID, which this login does not have access to.
  • 404: Order not found.